<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        var arr = ['关羽', '张飞', '赵云', '黄忠', '马超']
        // for (var i = 0; i< arr.length; i++) {
        //     // 通过索引取得数组中的项， arr[索引]
        //     console.log(arr[i]);
        // }
        // 核心用循环里面的计数器i代替数组里面的索引
        for (var i in arr) {
            console.log(arr[i]);
        }
    </script>
</head>
<body>
    
</body>
</html>